package utils

func Getcrc8(data []uint8) uint8 {
	crc := uint8(0) // Initial value
	for _, d := range data {
		crc ^= d
		for i := 0; i < 8; i++ {
			if crc&0x80 != 0 {
				crc = (crc << 1) ^ 0x07
			} else {
				crc <<= 1
			}
		}
	}
	return crc
}
